package com.yf;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Yang_Vincent
 * @Date 2020/7/23 16:14
 */
@SpringBootApplication
@EnableDiscoveryClient
@RestController
@RefreshScope
public class ConsulConfigApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConsulConfigApplication.class, args);
    }

    @Value("${my.name}")
    String name;

    @GetMapping("/hi")
    public String getInfo(){

        return name;
    }
}
